
import moment from 'moment'
import { stopsettle, companydetail, company } from '@/services/business';
import { Tooltip } from 'antd'

let pathobj = {
    open_account_num: "/wbn-api/salary/open_account",
    renewal_order_amount: "/wbn-api/salary/renewal_order",
    other_receiver_reward: "/wbn-api/salary/other_business_receiver",
    other_coordination_reward: "/wbn-api/salary/other_business_coordination",
    other_auxiliary_coordination_reward: "/wbn-api/salary/other_business_auxiliary_coordination",
    open_account_promoter_num: "/wbn-api/salary/open_account_promoter"

}

let open_account_num = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name",
    },
    {
        "title": "服务开始时间",
        "dataIndex": "service_start_time",
        "key": "service_start_time",
        width: 100,
    },
    {
        "title": "服务结束时间",
        "dataIndex": "service_end_time",
        "key": "service_end_time",
        width: 100,
    },
    {
        "title": "应收款",
        "dataIndex": "receivable",
        "key": "receivable",
        "search": false
    },
    {
        "title": "实际收款",
        "dataIndex": "actual_receive",
        "key": "actual_receive",
        "search": false
    },
    {
        "title": "接单时间",
        "dataIndex": "receive_order_time",
        "key": "receive_order_time",
        width: 100,
        render: (dom, row) => {
            return <Tooltip title={row.receive_order_time ? moment(row.receive_order_time).format("YYYY-MM-DD HH:mm:ss") : '-'}>
                <span className='oneline'>{row.receive_order_time ? moment(row.receive_order_time).format("YYYY-MM-DD HH:mm:ss") : '-'}</span>
            </Tooltip>
        }
    },
    {
        "title": "结算月份",
        "dataIndex": "complete_time",
        "key": "complete_time",
        "width": 88,
        render: (dom, row) => {
            return <Tooltip title={row.complete_time ? moment(row.complete_time).format("YYYY-MM") : '-'}>
                <span className='oneline'>{row.complete_time ? moment(row.complete_time).format("YYYY-MM") : '-'}</span>
            </Tooltip>
        }
    },
    {
        "title": "服务类型",
        "dataIndex": "service_type",
        "key": "service_type",
        render: (dom, row) => {
            return <span>{row.service_type == "account" ? "代账" : '其他'}</span>
        }
    },
    {
        "title": "首次收款",
        "dataIndex": "is_first",
        "key": "is_first",
        "render": (_, row) => {
            return <span>{row.is_first ? "是" : "否"}</span>
        }
    }
]

let renewal_order_amount = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name",
    },
    {
        "title": "区域名称",
        "dataIndex": "area_name",
        "key": "area_name",
        "search": false
    },
    {
        "title": "接单人",
        "dataIndex": "user_name",
        "key": "user_name",
        "search": false
    },
    {
        "title": "促单人",
        "dataIndex": "promoter_user_name",
        "key": "promoter_user_name",
        "search": false
    },
    {
        "title": "续单金额",
        "dataIndex": "price",
        "key": "price",
        "search": false
    },
    {
        "title": "服务开始时间",
        "dataIndex": "service_start_time",
        "key": "service_start_time",
        width: 100,
        "search": false
    },
    {
        "title": "服务结束时间",
        "dataIndex": "service_end_time",
        "key": "service_end_time",
        width: 100,
        "search": false
    },
    {
        "title": "本次结算时间",
        "dataIndex": "settle_time",
        "key": "settle_time",
        width: 100,
        "search": false
    },
    {
        "title": "收款日期",
        "dataIndex": "payment_time",
        "key": "payment_time",
        width: 100,
        "search": false
    },
    {
        "title": "收款方式",
        "dataIndex": "payment_name",
        "key": "payment_name",
        "search": false
    },
    {
        "title": "收款金额",
        "dataIndex": "payment_price",
        "key": "payment_price",
        "search": false
    }
]

let other_receiver_reward = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name",
        copyable: true
    },
    {
        "title": "联系人",
        "dataIndex": "customer_name",
        "key": "customer_name",
        ellipsis: true
    },
    {
        "title": "联系人手机号", width: 120,
        "dataIndex": "customer_phone",
        "key": "customer_phone",
        render: (_, row) => <Tooltip title={row.customer_phone}><a href={`tel:${row.customer_phone}`} className="oneline">{row.customer_phone}</a></Tooltip>
    },
    {
        "title": "区域名称",
        "dataIndex": "area_name",
        "key": "area_name",
        "search": false
    },
    {
        "title": "接单人",
        "dataIndex": "user_name",
        "key": "user_name",
        "search": false
    },
    {
        "title": "经办人",
        "dataIndex": "coordination_name",
        "key": "coordination_name",
        "search": false
    },
    {
        "title": "辅助经办人",
        "dataIndex": "auxiliary_coordination_name",
        "key": "auxiliary_coordination_name",
        "search": false
    },
    {
        title: '应收款',
        dataIndex: 'receivable',
        key: 'receivable',
        search: false,
    },
    {
        "title": "实际收款",
        "dataIndex": "actual_receive",
        "key": "actual_receive",
        search: false,
    }
]

let other_coordination_reward = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name",
        copyable: true
    },
    {
        "title": "联系人",
        "dataIndex": "customer_name",
        "key": "customer_name",
        ellipsis: true
    },
    {
        "title": "联系人手机号", width: 120,
        "dataIndex": "customer_phone",
        "key": "customer_phone",
        render: (_, row) => <Tooltip title={row.customer_phone}><a href={`tel:${row.customer_phone}`} className="oneline">{row.customer_phone}</a></Tooltip>
    },
    {
        "title": "区域名称",
        "dataIndex": "area_name",
        "key": "area_name",
        "search": false
    },
    {
        "title": "区域编码",
        "dataIndex": "area_code",
        "key": "area_code",
        "search": false,
        hideInTable: true
    },
    {
        "title": "接单人",
        "dataIndex": "user_name",
        "key": "user_name",
        "search": false
    },
    {
        "title": "经办人",
        "dataIndex": "coordination_name",
        "key": "coordination_name",
        "search": false
    },
    {
        "title": "辅助经办人",
        "dataIndex": "auxiliary_coordination_name",
        "key": "auxiliary_coordination_name",
        "search": false
    },
    {
        title: '应收款',
        dataIndex: 'receivable',
        key: 'receivable',
        search: false,
    },
    {
        "title": "实际收款",
        "dataIndex": "actual_receive",
        "key": "actual_receive",
        search: false,
    }
]

let other_auxiliary_coordination_reward = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name",
        copyable: true
    },
    {
        "title": "联系人",
        "dataIndex": "customer_name",
        "key": "customer_name",
        ellipsis: true
    },
    {
        "title": "联系人手机号", width: 120,
        "dataIndex": "customer_phone",
        "key": "customer_phone",
        render: (_, row) => <Tooltip title={row.customer_phone}><a href={`tel:${row.customer_phone}`} className="oneline">{row.customer_phone}</a></Tooltip>
    },
    {
        "title": "区域名称",
        "dataIndex": "area_name",
        "key": "area_name",
        "search": false
    },
    {
        "title": "区域编码",
        "dataIndex": "area_code",
        "key": "area_code",
        "search": false,
        hideInTable: true
    },
    {
        "title": "接单人",
        "dataIndex": "user_name",
        "key": "user_name",
        "search": false
    },
    {
        "title": "经办人",
        "dataIndex": "coordination_name",
        "key": "coordination_name",
        "search": false
    },
    {
        "title": "辅助经办人",
        "dataIndex": "auxiliary_coordination_name",
        "key": "auxiliary_coordination_name",
        "search": false
    },
    {
        title: '应收款',
        dataIndex: 'receivable',
        key: 'receivable',
        search: false,
    },
    {
        "title": "实际收款",
        "dataIndex": "actual_receive",
        "key": "actual_receive",
        search: false,
    }
]

let open_account_promoter_num = [
    {
        "title": "公司名称", width: 260,
        "dataIndex": "company_name",
        "key": "company_name"
    },
    {
        "title": "接单人姓名",
        "dataIndex": "user_name",
        "key": "user_name"
    },
    {
        "title": "促单人",
        "dataIndex": "promoter_user_name",
        "key": "promoter_user_name"
    }
]


export { pathobj, open_account_num, renewal_order_amount, other_receiver_reward, other_coordination_reward, other_auxiliary_coordination_reward, open_account_promoter_num }